const { app, BrowserWindow } = require("electron");

app.whenReady().then(() => {
  let mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    show: false,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
      enableRemoteModule: true  
    }
  });

  mainWindow.loadFile("./02-父子模态窗口/index.html");
  require("@electron/remote/main").initialize();
  require("@electron/remote/main").enable(mainWindow.webContents);

  mainWindow.on("ready-to-show", mainWindow.show);
  mainWindow.on("close", () => mainWindow = null);
});

app.on("window-all-closed", app.quit);